{% extends "base.html" %}  
{% block title %} 患者列表 {% endblock %}  

{% block content %} 

  <div class="container">

    <!-- Docs nav
    ================================================== -->
    <div class="row">
      <div class="span3 bs-docs-sidebar">
        <ul class="nav nav-list bs-docs-sidenav">
        <li><a href="{% url sle.views.list_patient %}"><i class="icon-chevron-right"></i> 返回列表</a></li>
          <li><a href="#hzzl"><i class="icon-chevron-right"></i> 患者资料</a></li>
          <li><a href="#hzyy"><i class="icon-chevron-right"></i> 患者诱因</a></li>
          <li><a href="#hzbz"><i class="icon-chevron-right"></i> 患者病状</a></li>
          <li><a href="#bqyb"><i class="icon-chevron-right"></i> 病情演变</a></li>
          <li><a href="#hzls"><i class="icon-chevron-right"></i> 患者历史</a></li>
          <li><a href="#tjbg"><i class="icon-chevron-right"></i> 体检报告</a></li>
          <li><a href="#flbz"><i class="icon-chevron-right"></i> 分类标准</a></li>
          
        </ul>
      </div>
      
      

<div class="span9">
              
          <section id="hzzl">
          <div class="page-header">
            <h2>患者资料</h2>
          </div>

        
<div class="bs-docs-example">

 <form id="hzzl_form" action="{% url sle.views.save_patient %}" method="POST" class="form-inline" >
 {% csrf_token %}
  <label class="control-label" for="inputName">患者姓名</label>
  <input name="patient_name" id="inputName" type="text" class="input-small" placeholder="患者姓名"/>
  <label class="control-label" for="inputAge">患者年龄</label>
  <input name="patient_age" id="inputAge" type="text" class="input-small" placeholder="患者年龄"/>
  <label class="control-label" for="birthdate">出生日期</label>
  <input name="patient_birthdate" id="birthdate" type="text" class="input-small" onFocus="HS_setDate(this)" placeholder="形如:2000-01-01"/><br/><br/>
  <label class="control-label" for="company">工作单位</label>
  <input name="patient_company" type="text" class="input-small" id="company" placeholder="工作单位" />
    <label class="control-label" for="home">家庭住址</label>
  <input name="patient_home" type="text" class="input-small" id="home" placeholder="家庭住址" />
      <label class="control-label" for="tel">联系号码</label>
  <input name="patient_tel" type="text" class="input-small" id="tel" placeholder="联系号码" /><br/><br/>
        <label class="control-label" for="patient_card">身份证号</label>
  <input name="patient_card" type="text" class="input-small" id="patient_card" placeholder="身份证号" />
        <label class="control-label" for="patient_native">患者籍贯</label>
  <input name="patient_native" type="text" class="input-small" id="patient_native" placeholder="患者籍贯" />
        <label class="control-label" for="patient_inputdate">填表日期</label>
  <input name="patient_inputdate" type="text" class="input-small" id="patient_inputdate" onFocus="HS_setDate(this)" placeholder="形如:2000-01-01" /><br/><br/>
  <label class="control-label" for="recordNo">登记号码</label>{{form.patient_number.errors}}
  <input name="patient_number" type="text" class="input-small" id="recordNo" placeholder="登记号" />
    <label class="control-label" for="patient_gender" style="margin-right:14px;">患者性别</label>
    <label class="radio" style="margin-right:35px;">
              <input type="radio" name="patient_gender" id="optionsRadios1" value="男" checked>
              男
            </label>
            <label class="radio">
              <input type="radio" name="patient_gender" id="optionsRadios2" value="女" >
              女
            </label>
    <label class="control-label" for="patient_remark"  style="margin-left:67px;">简单备注</label>
  <input name="patient_remark" type="text" class="input-small" id="patient_remark" placeholder="简单备注" /><br/><br/>
        <label class="control-label" for="PatientNo">门诊号码</label>{{form.Patient_no.errors}}
  <input name="Patient_no" type="text" class="input-small" id="PatientNo" placeholder="门诊号" />
  <button class="btn btn-mini btn-primary" type="button" id="add_PatientNo">增加门诊号</button><br/><br/>
    <label class="control-label" for="hospitalized">住院号码</label>{{form.hospitalized_no.errors}}
  <input name="hospitalized_no" type="text" class="input-small" id="hospitalized" placeholder="住院号" />
  <button class="btn btn-mini btn-primary" type="button" id="add_hospitNo">增加住院号</button><br/><br/>
<input type="hidden" id="new_patno" name="nno" value=""/>
<input type="hidden" id="new_hosno" name="nho" value=""/>
  <button id="hzzl_submit" type="submit" class="btn btn-info" style="float:right;">保存</button>

	

</form>

   
</div>


        
        </section>
        
        
        
                  <section id="hzyy">
          <div class="page-header">
            <h2>患者诱因</h2>
          </div>

        
<div class="bs-docs-example">
  
   <form id="hzyy_form" action="{% url sle.views.save_Infection %}" method="POST" class="form-inline" >{% csrf_token %}
  <label class="control-label" for="Infection">感染</label>
  <input name="Infection" id="Infection" type="text" class="input-small" placeholder="感染"/>
  <label class="control-label" for="Pregnancy">妊娠 </label>
  <input name="Pregnancy" id="Pregnancy" type="text" class="input-small" placeholder="妊娠"/>
  <label class="control-label" for="Drugs">药物 </label>
  <input name="Drugs" id="Drugs" type="text" class="input-small" placeholder="药物"/><br/><br/>
  <label class="control-label" for="Tired">劳累 </label>
  <input name="Tired" type="text" class="input-small" id="Tired" placeholder="劳累" />
    <label class="control-label" for="Menopause">绝经</label>
  <input name="Menopause" type="text" class="input-small" id="Menopause" placeholder="绝经" />
      <label class="control-label" for="Others">其他</label>
  <input name="Others" type="text" class="input-small" id="Others" placeholder="其他" /><br/><br/>
        <label class="control-label" for="Fitment">居室装修</label>
  <input name="Fitment" type="text" class="input-small" id="Fitment" placeholder="居室装修" />
        <label class="control-label" for="Psychogenic">精神因素</label>
  <input name="Psychogenic" type="text" class="input-small" id="Psychogenic" placeholder="精神因素" /><br/><br/>

  <button id="hzyy_submit" type="submit" disabled="true" class="btn btn-info" style="float:right;">保存</button>
</form>
  
</div>


        
        </section>
        
        
        
        
                  <section id="hzbz">
          <div class="page-header">
            <h2>患者病症</h2>
          </div>

        
<div class="bs-docs-example">

 <form id="hzbz_form" action="{% url sle.views.save_Manifestation %}" method="POST" class="form-inline" >{% csrf_token %}
    <label class="control-label" for="Menstruation">月经</label>
  <input name="Menstruation" type="text" class="input-small" id="Menstruation" placeholder="月经" style="width:630px;"/><br/><br/>
  <label class="control-label" for="Skin">皮肤 </label>
  <input name="Skin" id="Skin" type="text" class="input-small" placeholder="皮肤" style="width:630px;"/><br/><br/>
  <label class="control-label" for="Joint">关节 </label>
  <input name="Joint" id="Joint" type="text" class="input-small" placeholder="关节" style="width:630px;"/><br/><br/>
  <label class="control-label" for="Muscle">肌肉 </label>
  <input name="Muscle" type="text" class="input-small" id="Muscle" placeholder="肌肉"  style="width:630px;"/><br/><br/>
    <label class="control-label" for="Respiratory">呼吸</label>
  <input name="Respiratory" type="text" class="input-small" id="Respiratory" placeholder="呼吸" style="width:630px;" /><br/><br/>
      <label class="control-label" for="Cardiovascular">心血管</label>
  <input name="Cardiovascular" type="text" class="input-small" id="Cardiovascular" placeholder="心血管"  style="width:615px;"/><br/><br/>
        <label class="control-label" for="Digestive">消化系统</label>
  <input name="Digestive" type="text" class="input-small" id="Digestive" placeholder="消化系统"  style="width:600px;"/><br/><br/>
  <label class="control-label" for="Hemotologic">血液系统</label>
  <input name="Hemotologic" type="text" class="input-small" id="Hemotologic" placeholder="血液系统" style="width:600px;" /><br/><br/>
  <label class="control-label" for="Urinary">泌尿系统</label>
  <input name="Urinary" type="text" class="input-small" id="Urinary" placeholder="泌尿系统"  style="width:600px;"/><br/><br/>
  <label class="control-label" for="Nervous">神经系统</label>
  <input name="Nervous" type="text" class="input-small" id="Nervous" placeholder="神经系统"  style="width:600px;"/><br/><br/>
  <label class="control-label" for="Initial">首发症状 </label>
  <input name="Initial" id="Initial" type="text" class="input-small" placeholder="首发症状" style="width:600px;"/><br/><br/>
          <label class="control-label" for="Raynaud">雷诺氏现象</label>
  <input name="Raynaud" type="text" class="input-small" id="Raynaud" placeholder="雷诺氏现象" style="width:590px;" /><br/><br/>
  
  <button id="hzbz_submit" type="submit" disabled="true" class="btn btn-info" style="float:right;" >保存</button>
</form>

</div>


        
        </section>
        
        
        
        
                  <section id="bqyb">
          <div class="page-header">
            <h2>病情演变</h2>
          </div>

        
<div class="bs-docs-example">
  <form id="bqyb_form" action="{% url sle.views.save_Course %}" method="POST" class="form-inline" >{% csrf_token %}
    <label class="control-label" for="Course">病情演变</label>
  <textarea name="Course" type="text" class="input-small" id="Course" placeholder="病情演变" style="width:600px;"></textarea><br/><br/>
 
  <button id="bqyb_submit" type="submit" disabled="true" class="btn btn-info" style="float:right;">保存</button>
</form>
</div>


        
        </section>
        
        
        
                          <section id="hzls">
          <div class="page-header">
            <h2>患者历史</h2>
          </div>

        
<div class="bs-docs-example">
   <form id="hzls_form" action="{% url sle.views.save_History %}" method="POST" class="form-inline" >{% csrf_token %}
  <label class="control-label" for="Past">既往史</label>
  <input name="Past" id="Past" type="text" class="input-small" placeholder="既往史" style="width:615px;"/><br/><br/>
  <label class="control-label" for="Family">家族史  </label>
  <input name="Family" id="Family" type="text" class="input-small" placeholder="家族史" style="width:615px;"/><br/><br/>
  <label class="control-label" for="Birth">生育史  </label>
  <input name="Birth" id="Birth" type="text" class="input-small" placeholder="生育史" style="width:615px;"/><br/><br/>
  <label class="control-label" for="Pregnancy">妊娠次数  </label>
  <input name="Pregnancy" type="text" class="input-small" id="Pregnancy" placeholder="妊娠次数 " style="width:260px;"/>
    <label class="control-label" for="Birthtime">分娩</label>
  <input name="Birthtime" type="text" class="input-small" id="Birthtime" placeholder="分娩次数" style="width:280px;"/><br/><br/>
      <label class="control-label" for="Abortion">流产</label>
  <input name="Abortion" type="text" class="input-small" id="Abortion" placeholder="流产次数" style="width:290px;"/>
        <label class="control-label" for="Living">存活 </label>
  <input name="Living" type="text" class="input-small" id="Living" placeholder="存活数" style="width:280px;"/><br/><br/>
        <label class="control-label" for="F">F&nbsp;&nbsp;</label>
  <input name="Fs" type="text" class="input-small" id="F" placeholder="F数" style="width:300px;"/>
        <label class="control-label" for="M">M&nbsp;&nbsp;</label>
  <input name="Ms" type="text" class="input-small" id="M" placeholder="M数" style="width:290px;"/><br/><br/>

  <button id="hzls_submit" type="submit" disabled="true" class="btn btn-info" style="float:right;">保存</button>
</form>
</div>


        
        </section>
        
        
        
                          <section id="tjbg">
          <div class="page-header">
            <h2>体检报告</h2>
          </div>

        
<div class="bs-docs-example">
   <form id="tjbg_form" action="{% url sle.views.save_Physical %}" method="POST" class="form-inline" >{% csrf_token %}
    <label class="control-label" for="Lung">肺</label>
  <input name="Lung" type="text" class="input-small" id="Lung" placeholder="肺"  style="width:640px;"/><br/><br/>
        <label class="control-label" for="Heart">心</label>
  <input name="Heart" type="text" class="input-small" id="Heart" placeholder="心"  style="width:640px;"/><br/><br/>
  <label class="control-label" for="Liver">肝</label>
  <input name="Liver" type="text" class="input-small" id="Liver" placeholder="肝" style="width:640px;" /><br/><br/>
  <label class="control-label" for="Spleen">脾</label>
  <input name="Spleen" type="text" class="input-small" id="Spleen" placeholder="脾"  style="width:640px;"/><br/><br/>
    <label class="control-label" for="Hair">毛发</label>
  <input name="Hair" type="text" class="input-small" id="Hair" placeholder="毛发" style="width:630px;"/><br/><br/>
  <label class="control-label" for="Skin2">皮肤 </label>
  <input name="Skin2" id="Skin2" type="text" class="input-small" placeholder="皮肤" style="width:630px;"/><br/><br/>
  <label class="control-label" for="Edema">浮肿</label>
  <input name="Edema" type="text" class="input-small" id="Edema" placeholder="浮肿" style="width:630px;" /><br/><br/>
  <label class="control-label" for="Joint">关节</label>
  <input name="Joint" type="text" class="input-small" id="Joint" placeholder="关节"  style="width:630px;"/><br/><br/>
    <label class="control-label" for="Muscle2">肌肉</label>
  <input name="Muscle2" type="text" class="input-small" id="Muscle2" placeholder="肌肉" style="width:630px;" /><br/><br/>
  <label class="control-label" for="Vasculitis">血管炎 </label>
  <input name="Vasculitis" id="Vasculitis" type="text" class="input-small" placeholder="血管炎" style="width:615px;"/><br/><br/>
  <label class="control-label" for="Lymph">淋巴结</label>
  <input name="Lymph" id="Lymph" type="text" class="input-small" placeholder="淋巴结" style="width:615px;"/><br/><br/>
  <label class="control-label" for="Nervous2">神经系统</label>
  <input name="Nervous2" type="text" class="input-small" id="Nervous2" placeholder="神经系统"  style="width:600px;"/><br/><br/>
          
  
  <button id="tjbg_submit" type="submit"  disabled="true" class="btn btn-info" style="float:right;">保存</button>
</form>
</div>


        
        </section>
        
        
        
        
        
        
        <section id="flbz">
          <div class="page-header">
            <h2>分类标准</h2>
          </div>

        
<div class="bs-docs-example">
 
 <form id="flbz_form" action="{% url sle.views.save_Standard %}" method="POST" class="form-inline" >{% csrf_token %}
 
<div class="row-fluid">
            <div class="span6">
              <h2>I、口腔症状：</h2>
              <p>1、每日感口干持续3个月以上；</p>
              <label class="radio">
              <input type="radio" name="optionsRadios1" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios1" id="optionsRadios2" value="0" checked>
              否
            </label>
              
               <p>2、成年后腮腺反复或持续肿大；</p>
                <label class="radio">
              <input type="radio" name="optionsRadios2" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios2" id="optionsRadios2" value="0" checked>
              否
            </label>
              <p>3、吞咽干性食物时需用水帮助。</p>
               <label class="radio">
              <input type="radio" name="optionsRadios3" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios3" id="optionsRadios2" value="0" checked>
              否
            </label>
            </div><!--/span-->
            <div class="span6">
              <h2>II、眼部症状：</h2>
              <p>1、每日感到不能忍受的眼干持续3个月以上；</p>
              <label class="radio">
              <input type="radio" name="optionsRadios4" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios4" id="optionsRadios2" value="0" checked>
              否
            </label>
              
               <p>2、有反复的砂子进眼或砂磨感觉；</p>
                <label class="radio">
              <input type="radio" name="optionsRadios5" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios5" id="optionsRadios2" value="0" checked>
              否
            </label>
              <p>3、每日需用人工泪液3次或3次以上。</p>
               <label class="radio">
              <input type="radio" name="optionsRadios6" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios6" id="optionsRadios2" value="0" checked>
              否
            </label>
            </div><!--/span-->
           
          </div><!--/row-->
          
        <div class="row-fluid">
            <div class="span6">
              <h2>III、眼部体征：</h2>
              <p>1、Schirmer I 试验（＋）（£5mm/5分）；</p>
              <label class="radio">
              <input type="radio" name="optionsRadios7" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios7" id="optionsRadios2" value="0" checked>
              否
            </label>
              
               <p>2、角膜染色（＋）（³4 van Bijsterveld计分法）。</p>
                <label class="radio">
              <input type="radio" name="optionsRadios8" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios8" id="optionsRadios2" value="0" checked>
              否
            </label>
             
            </div><!--/span-->
            <div class="span6">
              <h2>IV、组织学检查：</h2>
              <p>下唇腺病理示淋巴细胞灶³1。（指4mm2组织内至少有50个淋巴细胞聚集于唇腺间质者为一灶）。</p>
              <label class="radio">
              <input type="radio" name="optionsRadios9" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios9" id="optionsRadios2" value="0" checked>
              否
            </label>
           
            </div><!--/span-->
           
          </div><!--/row-->
          
          <div class="row-fluid">
            <div class="span6">
              <h2>V、 唾液腺受损：</h2>
              <p>1、唾液流率（＋）（£1.5ml/15分）；</p>
              <label class="radio">
              <input type="radio" name="optionsRadios10" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios10" id="optionsRadios2" value="0" checked>
              否
            </label>
              
               <p>2、腮腺造影（＋）；（腮腺造影示弥漫性涎管扩张，斑点状、空洞状或破坏性改变，同时排除大导管阻塞的可能。）</p>
                <label class="radio">
              <input type="radio" name="optionsRadios11" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios11" id="optionsRadios2" value="0" checked>
              否
            </label>
            <p>3、唾液腺同位素检查（＋）（唾液腺闪烁扫描显示延迟摄取、浓度降低和/或示踪剂的延迟分泌）</p>
                <label class="radio">
              <input type="radio" name="optionsRadios12" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios12" id="optionsRadios2" value="0" checked>
              否
            </label>
             
            </div><!--/span-->
            <div class="span6">
              <h2>VI、自身抗体：</h2>
              <p>抗SSA/Ro或抗SSB/La（＋）（双扩散法）<br />抗SSA/Ro：&nbsp;&nbsp;&nbsp;&nbsp;抗SSB/La：</p>
              
              <label class="radio">
              <input type="radio" name="optionsRadios13" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios13" id="optionsRadios2" value="0" checked>
              否
            </label>
           
            </div><!--/span-->
           
          </div><!--row-->
          
          
                    <div class="row-fluid">
            <div class="span12">
              <h3>1、原发性干燥综合征：<h4>无任何潜在疾病的情况下，有下述2条则可诊断：</h4></h3>
              <p>a.符合表1中4条或4条以上，但必须含有条目IV（组织学检查）和/或条目VI（自身抗体）；</p>
              <label class="radio">
              <input type="radio" name="optionsRadios14" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios14" id="optionsRadios2" value="0" checked>
              否
            </label>
              
               <p>b.条目III、IV、V、VI 4条中任3条阳性。</p>
                <label class="radio">
              <input type="radio" name="optionsRadios15" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios15" id="optionsRadios2" value="0" checked>
              否
            </label>
           <h3>2、继发性干燥综合征：</h3>
              <p>患者有潜在的疾病（如任一结缔组织病），而符合表1的I和II中任1条，同时符合条目III、IV、V中任2条。</p>
              <label class="radio">
              <input type="radio" name="optionsRadios16" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios16" id="optionsRadios2" value="0" checked>
              否
            </label>
            <h3>3、必须除外：</h3>
              <p>颈头面部放疗史，丙肝病毒感染，爱滋病（AIDS），淋巴瘤，结节病，移植物抗宿主（GVH）病，抗乙酰胆碱药的应用（如阿托品、莨菪碱、溴丙胺太林、颠茄等）（距末次使用的时间间隔少于4倍药物半衰期）。</p>
              <label class="radio">
              <input type="radio" name="optionsRadios17" id="optionsRadios1" value="1" checked>
              是
            </label>
            <label class="radio">
              <input type="radio" name="optionsRadios17" id="optionsRadios2" value="0" checked>
              否
            </label>
           
           
           
           
             
            </div><!--/span-->
            
           
          </div><!--row-->
          
          <br />
                           
            <button id="flbz_submit" type="submit" disabled="true" class="btn btn-info" style="float:right;">保存</button>
          </form>

 
 
</div>


        
        </section>
        
        

                <section id="fhlb">

        </section>
       
       
       
       
       
</div>

</div>
</div>





{% endblock %} 

{% block some_js %}

<script type="text/javascript">

var flag = 1;
var newpn = '';
var newpn1 = '';

$("#add_PatientNo").click(function(){
  
    
    flag++;
	var $label = $("<div id='remove_pn"+flag+"'><br/><label class='control-label' for='PatientNo'>门诊号码 </label><input type='text' class='input-small' id='PatientNo"+flag+"' placeholder='门诊号' >  <button class='btn btn-mini btn-primary' onclick='deltr("+flag+")' type='button'>删除门诊号</button></div>");	
  
  $("#add_PatientNo").after($label);
  

  });
 
 
 $("#add_hospitNo").click(function(){
  
    
    flag++;
	var $label = $("<div id='remove_pn"+flag+"'><br/><label class='control-label' for='hospitalized'>住院号码 </label><input type='text' class='input-small' id='hospitalized"+flag+"' placeholder='住院号' >  <button class='btn btn-mini btn-primary' onclick='deltr("+flag+")' type='button'>删除住院号</button></div>");	
  
  $("#add_hospitNo").after($label);
  

  });



  
 
 $(document).ready(function() {
 
 
 $('#hzzl_form').validate({
 rules: {
			patient_name: "required",
			patient_age: {    
       						digits: true,
    						required: true
							},
			patient_birthdate:"dateISO",
//			patient_company:"required",
//			patient_home:"required",
			patient_tel: {    
       						digits: true,
							//required: true
							},
			patient_card: {    
       						digits: true,
//							required: true
							},
//			patient_native:"required",
			patient_inputdate:"dateISO",
			patient_number: {    
       						digits: true,
							required: true
							},
//			patient_gender:"required",	
			Patient_no: {    
       						digits: true,
							required: true
							},
			hospitalized_no: {    
       						digits: true,
							required: true
							},
			
		},
		messages: {
			patient_name: "必填",
			patient_age: "数字",
			patient_birthdate: "请输入正确的日期",
						patient_company:"必填",
			patient_home:"必填",
			patient_tel: "格式",
			patient_native: "必填",
			patient_inputdate: "请输入正确的日期",
			patient_number: "必填",
			patient_gender: "必填",	
			Patient_no: "数字",
			hospitalized_no: "数字",
			patient_card:"数字"

		
		},
		errorElement: "em",				//用来创建错误提示信息标签
		/*success: function(label) {			//验证成功后的执行的回调函数
			//label指向上面那个错误提示信息标签em
			label.text(" ")				//清空错误提示消息
				.addClass("success");	//加上自定义的success类
		}*/
		
 
 });
 
 
  //提交开始
 $('#flbz_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#flbz_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               window.location.href="{% url sle.views.list_patient %}";
                }
            });
            return false;

		});//提交结束 
 
 
 
 //提交开始
 $('#tjbg_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#tjbg_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               
                }
            });
            return false;

		});//提交结束 
 
 //提交开始
 $('#hzls_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#hzls_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               
                }
            });
            return false;

		});//提交结束 
 
 
 
 //提交开始
 $('#bqyb_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#bqyb_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               
                }
            });
            return false;

		});//提交结束 
 
 
 //提交开始
 $('#hzbz_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#hzbz_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               
                }
            });
            return false;
        
		
		
		});//提交结束  
 
        $('#hzyy_form').submit(function() {
		$('#showmessage').css("display","block");
		$.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..
				$('#showmessage').text('信息已经保存!');
                  $('#hzyy_submit').attr('disabled',"true");
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
               
                }
            });
            return false;
        
		
		
		});//提交结束
          
 
 
        $('#hzzl_form').submit(function() { // catch the form's submit event
                
        if($('#inputName').val()==''||$('#inputName').val()==null){
		alert('患者名称不可以为空！');
		 return false;
		}
		if($('#inputAge').val()==''||$('#inputAge').val()==null){
		alert('患者年龄不可以为空！');
		return false;
		}
		if($('#birthdate').val()==''||$('#birthdate').val()==null){
		alert('患者出生日期不可以为空！');
		return false;
		}
		if($('#patient_inputdate').val()==''||$('#patient_inputdate').val()==null){
		alert('填表日期不可以为空！');
		return false;
		}
		if($('#recordNo').val()==''||$('#recordNo').val()==null){
		alert('登记号不可以为空！');
		return false;
		}
		if($('#PatientNo').val()==''||$('#PatientNo').val()==null){
		alert('门诊号不可以为空！');
		return false;
		}
		if($('#hospitalized').val()==''||$('#hospitalized').val()==null){
		alert('住院号不可以为空！');
		return false;
		}
		
		
		var new_patientno = $('input[id^=PatientNo]');
		var new_hospno = $('input[id^=hospitalized]');
		
		$.each(new_hospno,function(i){
  
  		if(i>0){
  		newpn1+='-'+this.value;
  		}else{
  		newpn1+=this.value;
  		}
  
  		});
		
		
        $.each(new_patientno,function(i){
  
  		if(i>0){
  		newpn+='-'+this.value;
  		}else{
  		newpn+=this.value;
  		}
  
  		});
		
		
        $('input[id=new_patno]').val(newpn);
		$('input[id=new_hosno]').val(newpn1);
        $('#showmessage').css("display","block");
		
        
            $.ajax({ // create an AJAX call...
                data: $(this).serialize(), // get the form data
                type: $(this).attr('method'), // GET or POST
                url: $(this).attr('action'), // the file to call
                success: function(response,textStatus) { // on success..

				if(response==1){
				
				$('#showmessage').text('信息已经保存!');
				
                  $('#hzzl_submit').attr('disabled',"true");
				  
				  setTimeout(function() {
				  $('#showmessage').css("display","none");
				  }, 1500);
				  $('#hzyy_submit').removeAttr("disabled");
				  $('#hzbz_submit').removeAttr("disabled");
				  $('#bqyb_submit').removeAttr("disabled");
				  $('#hzls_submit').removeAttr("disabled");
				  $('#tjbg_submit').removeAttr("disabled");
				  $('#flbz_submit').removeAttr("disabled");
				  
				  
                   }//if end
                }
            });
            return false;
        });//提交结束


   
    }); //onready end 
    
    
 
 
   var deltr =function(index)
    {

    $("#remove_pn"+index).remove();
    
  }
 
  
$('#recordNo').blur(function(){

$.ajax({ // create an AJAX call...
                data: {patient_number:$('#recordNo').val()}, // get the form data
                type: "GET", // GET or POST
                url: "{% url sle.views.check_record %}", // the file to call
                success: function(response,textStatus) { // on success..
                  if (response==1){
				  alert("此登记号已经使用过,请换号!");
				  $('#recordNo').focus();
				  }
                
                }
            });
            return false;
        });
		
  
  
  
 
  </script>

{% endblock %}